Recently most electronic devices have an I/O interface for a universal serial bus (USB). When a certain electronic device is connected to an external electronic device through the I/O interface, the electronic device can transmit or exchange data to or with the external electronic device. The I/O interface may perform a charging function of the external electronic device connected to the electronic device as well as a data communication function. In this case, operating modes for performing these respective functions may be established in the I/O interface. For example, depending on functions being performed, the I/O interface may have a mode of targeting a data communication with the external electronic device and a dedicated charging mode only for charging of the external electronic device. In this case, the electronic device including the I/O interface may change the operating mode of the I/O interface to the data communication mode or the charging mode, depending on a user's manual input. However, since a user cannot exactly know the established operating mode of the I/O interface, a new external electronic device connected to the electronic device which is in the charging mode may often cause a failure in recognition. Also, in case of changing or establishing the operating mode of the I/O interface to the charging mode even though the external electronic device does not support the charging mode, the external electronic device connected to the electronic device may often cause a failure in recognition and a failure in operation.